package com.bh.wms.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bh.common.annotation.Excel;
import com.bh.common.core.domain.BhtmsBaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.util.Date;
import java.util.List;

/**
 * 调拨/移库单
 *
 * @author GPT
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_transfer_order")
@ApiModel(value = "调拨单", description = "仓间调拨/仓内移库单")
public class WmsTransferOrder extends BhtmsBaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("调拨单号")
    @Excel(name = "调拨单号")
    private String orderNo;

    @ApiModelProperty("调拨类型 inner-仓内 between-仓间")
    @Excel(name = "调拨类型")
    private String transferType;

    @ApiModelProperty("来源仓库ID")
    @Excel(name = "来源仓库ID")
    private Long sourceWarehouseId;

    @ApiModelProperty("目标仓库ID")
    @Excel(name = "目标仓库ID")
    private Long targetWarehouseId;

    @ApiModelProperty("来源库区ID")
    @Excel(name = "来源库区ID")
    private Long sourceZoneId;

    @ApiModelProperty("目标库区ID")
    @Excel(name = "目标库区ID")
    private Long targetZoneId;

    @ApiModelProperty("计划执行时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "计划执行时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date planExecuteTime;

    @ApiModelProperty("完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date finishedTime;

    @ApiModelProperty("调拨状态 created/executing/finished/cancelled")
    @Excel(name = "状态")
    private String orderStatus;

    @ApiModelProperty("外部物流单号预留")
    private String transportNo;

    @TableField(exist = false)
    @ApiModelProperty("调拨明细")
    private List<WmsTransferOrderDetail> details;
}

